"""
应用常量定义
"""

# API 路由前缀常量
API_PREFIX = "/demo/py"

# 请求头常量
AUTHORIZATION = "Authorization"
HEADER_TRACE_ID = "Trace-Id"
SAME_TOKEN = "SA-SAME-TOKEN"

# Mdc 常量
MDC_TRACE_ID = "traceId"

# Nacos 常量
NACOS_LOGS_SERVICE_NAME = "logs-server"
NACOS_AUTH_SERVICE_NAME = "auth-server"

# redis 限流
LIMIT_DESCRIBE = "你的访问过于频繁，请稍后再试"

# Redis Key 常量
REDIS_KEY_DEFAULT_EXPIRE = 60 * 60 * 24  # 缓存1天
REDIS_KEY_USER_ROLE_KEY = "python:user:role"  # 用`python:`为前缀区分java项目和python项目的key
REDIS_KEY_USER_PERMISSION_KEY = "python:user:permission"
LOGIN_TYPE = "login"
REDIS_KEY_USER_TOKEN = f"{AUTHORIZATION}:{LOGIN_TYPE}:token"
REDIS_KEY_TOKEN_LAST_ACTIVE = f"{AUTHORIZATION}:{LOGIN_TYPE}:last-active"
REDIS_KEY_SAME_TOKEN = f"{AUTHORIZATION}:var:same-token"
REDIS_KEY_PAST_SAME_TOKEN = f"{AUTHORIZATION}:var:past-same-token"
